<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>博客管理</title>
    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/>
    <link href="blog/css/base.css" rel="stylesheet">
    <link href="blog/css/index.css" rel="stylesheet">
    <link rel="stylesheet" href="element/element.css">
    <script type="application/javascript" src="md/js/jquery.min.js"></script>
    <script type="application/javascript" src="vue/vue.js"></script>
    <script type="application/javascript" src="element/element.js"></script>

</head>
<body>
<div id="app">
    <el-container>
        <el-header style="padding: 0;">
            <header class="header-navigation" id="header">
                <nav>
                    <div class="logo"><a href="https://www.tangfd.club">黑色的眼睛 の 个人博客</a></div>
                    <h2 id="mnavh"><span class="navicon"></span></h2>
                    <ul id="starlist">
                        <li><a href="/">首页</a></li>
                        <li><a href="about">关于我</a></li>
                        <li><a href="share">模板分享</a></li>
                        <li><a href="list">博客日记</a></li>
                        <li><a href="info">慢生活</a></li>
                        <li><a href="time">时间轴</a></li>
                    </ul>
                    <div class="searchbox">
                        <div id="search_bar" class="search_bar">
                            <form id="searchform" action="[!--news.url--]e/search/index.php" method="post"
                                  name="searchform">
                                <input class="input" placeholder="想搜点什么呢.." type="text" name="keyboard" id="keyboard">
                                <input type="hidden" name="show" value="title"/>
                                <input type="hidden" name="tempid" value="1"/>
                                <input type="hidden" name="tbname" value="news">
                                <input type="hidden" name="Submit" value="搜索"/>
                                <p class="search_ico"><span></span></p>
                            </form>
                        </div>
                    </div>
                </nav>
            </header>
        </el-header>
        <el-main style="width: 100%;">
            <template>
                <el-tabs v-model="activeName" @tab-click="handlePanelClick">
                    <el-tab-pane label="文章管理" name="first">
                        <div>
                            <div>
                                <el-form :inline="true" :model="formInline" class="demo-form-inline">
                                    <el-form-item label="审批人">
                                        <el-input v-model="formInline.user" placeholder="审批人"></el-input>
                                    </el-form-item>
                                    <el-form-item label="活动区域">
                                        <el-select v-model="formInline.region" placeholder="活动区域">
                                            <el-option label="区域一" value="shanghai"></el-option>
                                            <el-option label="区域二" value="beijing"></el-option>
                                        </el-select>
                                    </el-form-item>
                                    <el-form-item>
                                        <el-button type="primary" @click="onSubmit">查询</el-button>
                                    </el-form-item>
                                </el-form>
                            </div>
                            <el-button type="primary" icon="el-icon-edit">写文章</el-button>
                            <div>
                                <el-table
                                        :data="tableData"
                                        stripe
                                        style="width: 100%">
                                    <el-table-column
                                            prop="date"
                                            label="日期"
                                            width="180">
                                    </el-table-column>
                                    <el-table-column
                                            prop="name"
                                            label="姓名"
                                            width="180">
                                    </el-table-column>
                                    <el-table-column
                                            prop="address"
                                            label="地址">
                                    </el-table-column>
                                </el-table>
                            </div>
                            <div>
                                <el-pagination
                                        background
                                        hide-on-single-page
                                        layout="sizes, prev, pager, next, jumper, ->, total"
                                        @size-change="sizeChange"
                                        @current-change="currentChange"
                                        @prev-click="prevClick"
                                        @next-click="nextChange"
                                        :total="1000">
                                </el-pagination>
                            </div>
                        </div>
                    </el-tab-pane>
                    <el-tab-pane label="类别管理" name="second">
                        <el-input placeholder="输入关键字进行过滤"
                                v-model="filterText">
                        </el-input>
                        <el-tree class="filter-tree"
                                :data="data"
                                 accordion
                                :props="defaultProps"
                                default-expand-all
                                :filter-node-method="filterNode"
                                ref="tree2">
                        </el-tree>
                    </el-tab-pane>
                    <el-tab-pane label="标签管理" name="third">标签管理</el-tab-pane>
                </el-tabs>
            </template>
        </el-main>
        <el-footer>
            <footer>
                <p>
                    <a href="/" target="_blank">{{footer}}</a>
                </p>
            </footer>
        </el-footer>
    </el-container>
</div>
</body>
<script type="text/javascript">
    $(function () {
        var vue = new Vue({
            el: '#app',
            data: {
                footer: '黑色的眼睛 の 个人博客 - 皖ICP备19004316号',
                activeName: 'first',
                filterText: '',
                formInline: {
                    user: '',
                    region: ''
                },
                tableData: [{
                    date: '2016-05-02',
                    name: '王小虎',
                    address: '上海市普陀区金沙江路 1518 弄'
                }, {
                    date: '2016-05-04',
                    name: '王小虎',
                    address: '上海市普陀区金沙江路 1517 弄'
                }, {
                    date: '2016-05-01',
                    name: '王小虎',
                    address: '上海市普陀区金沙江路 1519 弄'
                }, {
                    date: '2016-05-03',
                    name: '王小虎',
                    address: '上海市普陀区金沙江路 1516 弄'
                }],
                data: [{
                    id: 1,
                    label: '一级 1',
                    children: []
                }, {
                    id: 2,
                    label: '一级 2',
                    children: []
                }, {
                    id: 3,
                    label: '一级 3',
                    children: []
                }],
                defaultProps: {
                    children: 'children',
                    label: 'label'
                }
            },
            methods: {
                onSubmit() {

                },
                handlePanelClick(tab, event) {
                    console.log(tab, event);
                },
                sizeChange(pageSize) {
                    console.log(pageSize)
                },
                currentChange(pageNo) {
                    console.log(pageNo)
                },
                prevClick(pageNo) {
                    console.log(pageNo)
                },
                nextChange(pageNo) {
                    console.log(pageNo)
                },
                filterNode(value, data) {
                    if (!value) return true;
                    return data.label.indexOf(value) !== -1;
                }
            },
            watch: {
                filterText(val) {
                    this.$refs.tree2.filter(val.trim());
                }
            }
        });


    });
</script>
</html>
